This disclosure relates generally to the field of graphics processing. More particularly, but not by way of limitation, this disclosure relates to methods for the non-intrusive monitoring of shader program execution during application development.
Many present-day portable device applications are graphics intensive. To support the needed graphics operations many portable devices incorporate one or more graphics processing units (GPUs). It can be particularly important to optimize shader program performance in such environments as one or a few inefficiently executing shader operations can have a noticeably deleterious effect on a program's overall behavior. For at least these reasons, it is important to obtain accurate quantitative measurements of shader program run-time performance.
As used herein, the terms “shader program” or “shader” refer to programs specifically designed to execute on GPU hardware. Illustrative types of shader programs include vertex, geometry, tessellation (hull and domain) and fragment (or pixel) shaders. While the claimed subject matter is not so limited, vertex, fragment, and compute shaders are supported by Metal—a well-known framework that supports GPU-accelerated advanced 3D graphics rendering and data-parallel computation workloads. In general, vertex shaders provide control over the position and other attributes in scenes involving three-dimensional (3D) models. In particular, vertex shaders transform each vertex's 3D position in virtual space to the corresponding two-dimensional (2D) coordinate at which it will appear on a screen. Output from a vertex shader may be sent directly to a rasterizer or to the next stage in a GPU's pipeline (e.g., a fragment shader). Fragment shaders, also known as pixel shaders, may be used to compute the color and other attributes of each pixel. Fragment shaders may, for example, be used to output a constant color or for the application of lighting values, shadows, specular highlights, and translucency.